﻿using System;
using System.Drawing;

namespace MarioMapEditor
{
    class ObFlagTree : ObObject
    {
        public enum FLAG {FLAGTREE = 80};

        public ObFlagTree()
        {
            Width = 1;
            Height = 10;
        }

        public ObFlagTree(FLAG nid)
        {
            ID = (int)nid;
            Width = 1;
            Height = 10;
        }

        public override bool SetID(int nID)
        {
            if (checkType(nID))
            {
                ID = nID;
                return true;
            }
            return false;
        }

        public static bool checkType(int objectID)
        {
            if (Enum.IsDefined(typeof(FLAG), objectID))
            {
                return true;
            }
            return false;
        }

        public override Bitmap GetBitmap()
        {
            if (!checkType(ID))
            {
                return null;
            }
            switch (ID)
            {
                case (int)FLAG.FLAGTREE:
                    var src = Properties.Resources.ScoreTree;
                    return MainForm.ResizeImage(src, new Size(Width * MainForm.TileSize, Height * MainForm.TileSize));
            }
            return null;
        }

    }
}
